package com.fashiontextile.user.mapper;

import com.fashiontextile.user.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * @author brooke_zb
 */
@Mapper
public interface UserMapper {
    User selectByUid(Long uid);

    User selectByUsername(String username);

    User selectByEmail(String email);

    Integer updateEmail(@Param("newemail") String newEmail, @Param("uid") Long uid);

    Integer updateAvatar(@Param("avatarUrl") String avatarUrl, @Param("uid") Long uid);

    Integer updatePasswold(@Param("newPasswold") String newpasswold, @Param("uid") Long uid);

    Integer insertUser(User user);

    List<User> getAllUser(String keyword);

    Integer updateUserState(@Param("uid") Long uid, @Param("enable") Integer enable);

    Integer changeRoleByUid(@Param("uid") long uid,@Param("rid") Integer rid);
}
